<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/mall-common :: common_head(~{::title},~{::link},~{::script})">
  <title>网上图书商城</title>
  <link rel="stylesheet" href="/styles/mall/my-order.css">
  <script src="/javascript/mall/my-cart.js" type="text/javascript"></script>
</head>
<body>
<div th:replace="common/mall-common::mall-header"></div>
<div class="mall-body">
  <div class="title">我的订单</div>
  <div class="order-list">
    <a class="order-item" th:each="item,info:${orderlist.list}" th:href="'/order-detail?orderId=' + ${item.id}">
      <div class="top-line">
        <div th:text="'订单时间：' + ${item.createAt}" class="order-at"></div>
        <div th:text="'共消费：' + ${item.totalPrice} + '元'" class="order-price"></div>
      </div>
      <div class="order-info" th:if="${item.orderItemDTOList.size() > 1}"
           th:text="'订单中包含了' + ${item.orderItemDTOList.get(0).books.name} + '等' + ${item.totalCount} + '件商品'"></div>
      <div class="order-info" th:if="${item.orderItemDTOList.size() == 1}"
           th:text="'购买了' + ${item.orderItemDTOList.get(0).books.name}"></div>
      <div th:class="'order-state order-state-' + ${item.state}" th:text="'订单状态：' + ${item.state == 0 ? '待支付' : '已完成'}"></div>
    </a>

  </div>
  <div th:replace="common/mall-common::common_pager(${orderlist})"></div>

</div>
<div th:replace="common/mall-common::mall-footer"></div>
</body>
</html>
>